package personal.gj.exam.Controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import personal.gj.exam.Model.Order;
import personal.gj.exam.Service.OrderService;

import java.util.List;

@Controller
@RequestMapping("/user")
public class OrderController {

    @Autowired
    OrderService orderService;

    @GetMapping("/list")
    public String list(Model model) {
        List<Order> order=orderService.findAll();
        model.addAttribute("order", order);
        return "listOrder";
    }
}
